package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.pojo.SysFunction;
import com.nineclock.system.service.SysFunctionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：zhouc
 * @date ：Created in 2021/6/24
 * @description ：
 * @version: 1.0
 */
@RestController
@RequestMapping("/function")
public class SysFunctionController {
    
    @Autowired
    SysFunctionService functionService;
    @GetMapping("/findFunctionByUsername")
    public Result<List<SysFunction>> findFunctionByUsername(
        @RequestParam(value = "username") String username,
        @RequestParam(value = "companyId1") Long companyId1) throws Exception {
        List<SysFunction> functionByUsernameList = functionService.findFunctionByUsername(username,companyId1);
        
        return Result.success(functionByUsernameList);
    }

}
